<div class="page-wrapper d-flex flex-column pt-4 w-100">
    <div class="container-xl">
        <div class="page-header d-print-none">
            <div class="row align-items-center">
                <div class="col">
                    <div class="page-pretitle">
                        Creating
                    </div>
                    <h3 class="page-title">
                        New Translation
                    </h3>
                </div>
            </div>
        </div>
    </div>
    <div class="page-body d-flex flex-row-reverse">
        <aside class="bd-sidebar sub-sidebar">

            <nav class="bd-links p-3" aria-label="Sub-section navigation">
                <div class="card">
                    <actions preview-url="viewmodel.fullPath" back-url="'/portal/localize/list'">
                    </actions>
                </div>
            </nav>
        </aside>

        <!-- ----------------------------------------------------------- -->

        <div class="content-body py-3 pe-3">
            <div class="card">

                <!-- Main content -->
                <section class="card-body" ng-init="getSingle()">
                    <form ng-if="viewmodel" ng-class="{'submitted': submitted}" ng-submit="save()">

                        <div class="row">
                            <section class="col-lg-12">
                                <div class="mb-3">
                                    <label class="form-label">Keyword</label>
                                    <input type="text" ng-disabled="!isAdmin" required
                                        class="form-control form-control-lg" ng-model="viewmodel.keyword">
                                </div>
                                <div class="row">
                                    <div class="col">
                                        <div class="mb-3" ng-if="isAdmin">
                                            <label class="form-label">Category</label>
                                            <select class="form-select" ng-model="viewmodel.category">
                                                <option ng-repeat="item in cates" ng-value="item">{{item}}</option>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="col">
                                        <div class="mb-3" ng-if="isAdmin">
                                            <label class="form-label">Type</label>
                                            <mix-select model="viewmodel.dataType" options="globalSettings.dataTypes"
                                                callback="initEditors(type)">
                                            </mix-select>
                                        </div>
                                    </div>
                                </div>
                                <div class="mb-3">
                                    <label class="form-label">Value</label>
                                    <module-form-editor ng-if="viewmodel" data="viewmodel.property"
                                        column-title="viewmodel.title" input-class="me-2"></module-form-editor>
                                </div>
                                <div class="mb-3" ng-show="isAdmin">
                                    <label class="form-label">Default value</label>
                                    <module-form-editor ng-if="viewmodel" data="viewmodel.property"
                                        column-title="viewmodel.title" input-class="me-2"></module-form-editor>
                                </div>

                                <div class="mb-3" ng-if="isAdmin">
                                    <label class="form-label">Description</label>
                                    <textarea type="text" class="form-control"
                                        ng-model="viewmodel.description"></textarea>
                                </div>

                            </section>
                        </div>
                    </form>
                </section>
                <!-- /.content -->
            </div>

        </div>
    </div>
</div>